#include <lib/stdlib.h>
#include <lib/string.h>
#include <lib/stdio.h>
#include <driver/view/hal.h>
#include <driver/view/mouse.h>
#include <sys/ipc.h>

int ViewSectionOpen(view_section_t *section)
{
    section->addr = KMemAlloc(section->size);
    if (section->addr)
        return 0;
    return -1;
}

int ViewSectionClose(view_section_t *section)
{
    if (!section->addr)
        return -1;
    KMemFree(section->addr);
    section->addr = NULL;
    return 0;
}